package com.haiqiu.tool.excel.utils;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
 * HttpServletUtils工具
 * @author haiqiu
 */
public class HqHttpServletUtils {
    public static HttpServletRequest getServletRequest() {
        HttpServletRequest request =
                ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
        return request;
    }

    public static HttpServletResponse getServletResponse() {
        HttpServletResponse response =
                ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getResponse();
        return response;
    }
}